import {
	CoreReg,
	Internal,
	MCU_Core,
	Peripheral,
	DissassembleLine
} from "./structs.slint";

export global TestData {
	property <[CoreReg]> mcu_core_core : [
		{ name: "R0",   value : "0x00000000" },
		{ name: "R1",   value : "0x00000000" },
		{ name: "R2",   value : "0x00000000" },
		{ name: "R3",   value : "0x00000000" },
		{ name: "R4",   value : "0x00000000" },
		{ name: "R5",   value : "0x00000000" },
		{ name: "R6",   value : "0x00000000" },
		{ name: "R7",   value : "0x00000000" },
		{ name: "R8",   value : "0x00000000" },
		{ name: "R9",   value : "0x00000000" },
		{ name: "R10",  value : "0x00000000" },
		{ name: "R11",  value : "0x00000000" },
		{ name: "R12",  value : "0x00000000" },
		{ name: "R13",  value : "0x00000000" },
		{ name: "R14",  value : "0x00000000" },
		{ name: "R15",  value : "0x00000000" },
		{ name: "xPSR", value : "0x00000000" },
	];
	property <[CoreReg]> mcu_core_banked : [
		{ name: "MSP",   value : "0x00000000" },
		{ name: "PSP",   value : "0x00000000" },
	];
	property <[CoreReg]> mcu_core_system : [
		{ name: "BASEPRI",   value : "0x00" },
		{ name: "PRIMASK",   value : "0" },
		{ name: "FAULTMASK", value : "0" },
		{ name: "CONTROL",   value : "0x00" },
	];
	property <Internal> mcu_core_internal : {
		Mode: "Thread test",
		Privilege: "Privileged test",
		Stack: "MSP",
		States: 6666,
		Sec: 0.0123,
	};
	out property <MCU_Core> mcu_core : {
		Core: mcu_core_core,
		Banked: mcu_core_banked,
		System: mcu_core_system,
		Internal: mcu_core_internal,
		BreakPoint: [0]
	};
	
	out property <[string]> probe_list : [
		"probe dev 0", "probe dev 1", "probe dev 2", 
	];
	out property <[string]> core_list : [
		"armv7m", "armv8m", "armv6m", "riscv", 
	];
	out property <[Peripheral]> peripherals : [
		{
			name: "Peripheral 1",
			base_addr: 0,
			registers: [
				{
					name: "registers 11",
					value: "value 11",
					addr_offset: 0,
					fields: [
						{
							name: "fields 111",
							value: "value 111",
							bit_offset: 0,
							bit_width: 1,
						}
					]
				},
				{
					name: "registers 12",
					value: "value 12",
					addr_offset: 1,
					fields: []
				}
			],
		},
		{
			name: "Peripheral 2",
			base_addr: 1,
			registers: [
				{
					name: "registers 21",
					value: "value 21",
					addr_offset: 0,
					fields: [
						{
							name: "fields 21",
							value: "value 21",
							bit_offset: 0,
							bit_width: 1,
						}
					]
				},
				{
					name: "registers 22",
					value: "value 22",
					addr_offset: 1,
					fields: [
						{
							name: "fields 21",
							value: "value 21",
							bit_offset: 0,
							bit_width: 2,
						}
					]
				}
			],
		},
	];
	
	out property <[DissassembleLine]> dissassemble_line : [
		{
			breakpoint: false,
			address: 0,
			assemble: "Mov r1, 0"
		},{
			breakpoint: false,
			address: 1,
			assemble: "Mov r1, 1"
		},{
			breakpoint: true,
			address: 1,
			assemble: "Mov r1, 2"
		},{
			breakpoint: false,
			address: 1,
			assemble: "Mov r1, 3"
		}
	];
}